package concurrent.push;

import utils.DateTimeUtils;

import java.util.Date;

/**
 * Author: Jason Wu
 * Date  : 2013-12-20
 */
public class Task extends PushingTask {
    @Override
    protected void push(int index) {
        try {
            Thread.sleep(2000);
            System.out.println(String.format("Thread:%d - %s", index, DateTimeUtils.formatDate(new Date(), DateTimeUtils.DATE_TIME_FORMAT)));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    @Override
    protected String getKey() {
        return null;
    }
}
